import React from 'react'
import MdEditor from 'react-markdown-editor-lite';
// import style manually
import 'react-markdown-editor-lite/lib/index.css';

import ReactMarkdown from 'react-markdown'

// Register plugins if required
// MdEditor.use(YOUR_PLUGINS_HERE);

// Initialize a markdown parser
// const mdParser = new MarkdownIt(/* Markdown-it options */);

// Finish!
function handleEditorChange({ html, text }) {
  console.log('handleEditorChange', html, text);
}
function Md() {
  return (
    <div>
      <h1>markDown编辑器</h1>
      <MdEditor style={{ height: '500px' }} renderHTML={text => {
        return <ReactMarkdown>{ text }</ReactMarkdown>
      }} onChange={handleEditorChange} />
    </div>
  )
}

export default Md
